using System;
using Deepcode.Flux.Core.Codons;
using Deepcode.Flux.Core.Extensions;
using Deepcode.Flux.Core.Extensions.Codons;
using Deepcode.Flux.Core.Systems.Security;

namespace Deepcode.Flux.Core.Codons.Security
{
	/// <summary>
	/// <Permission 
	///		id="cmsAccess" 
	///		title="User can access the CMS system"/>
	/// 
	/// Codon representing a permission available for binding to user groups
	/// 
	/// </summary>
	[XmlCodonName("Permission")]
	public class PermissionCodon: AbstractCodon
	{
		[XmlCodonAttribute("title")]
		private string title = "";

		public override object BuildItem(object owner, System.Collections.ArrayList subItems)
		{
			Permission p = new Permission( this.ID, title );
			return p;
		}
	}
}
